home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 52
/
Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso
/
Aminet
/
game
/
patch
/
WHDIGamesC-D.lzh
/
Deflektor.lha
/
Deflektor
/
deflektorslave.asm
< prev
next >
Wrap
Assembly Source File
|
2000-11-09
|
6KB
|
338 lines
;*---------------------------------------------------------------------------
; :Program. deflektorslave.asm
; :Contents. Slave for "Deflektor"
; :Author. Harry
; :History. 12.07.97/30.10.2000/9.11.2000
; :Requires. whdload-package :)
; :Copyright. Freeware
; :Language. 68000 Assembler
; :Translator. ASM-One 1.25
; :To Do.
;---------------------------------------------------------------------------*
;crc_v1 = $3E9F
;crc_v2 = $34C8
WHDLV = 10
INCDIR asm-one:Include2.0/
INCLUDE own/whdload.i
INCLUDE own/CCRMAKRO
checkdisk=0
; OUTPUT wart:gods/gods.slave
; BOPT O+ OG+ ;enable optimizing
; BOPT w4- ;disable 64k warnings
;======================================================================
SLBASE
.base SLAVE_HEADER ;ws_Security + ws_ID
dc.w WHDLV ;ws_Version
dc.w WHDLF_Disk!WHDLF_NoError!WHDLF_EmulTrap ;ws_flags
dc.l $80000 ;ws_BaseMemSize ;$bc000
dc.l $00 ;ws_ExecInstall
dc.w SLStart-.base ;ws_GameLoader
dc.w 0 ;ws_CurrentDir
dc.w 0 ;ws_DontCache
_keydebug dc.b $5C ;ws_keydebug = F9
_keyexit dc.b $5D ;ws_keyexit = F10
IF WHDLV>=10
DC.L 0 ;no fastmem
dc.w slname-SLBASE
dc.w slcr-SLBASE
dc.w slinst-SLBASE
***********************************************************************
slname dc.b 'Deflektor',0
slcr dc.b '1988 Gremlin',0
slinst dc.b 'HD-V1.11 Nov. 2000 by Harry',0
ENDC
;======================================================================
; DOSCMD "WDate >T:date"
dc.b "$VER:Deflektor_Slave_1.11"
; INCBIN "T:date"
dc.b 0
even
;======================================================================
SLStart ; A0 = resident loader
;======================================================================
lea (_resload,pc),a1
move.l a0,(a1) ;save for later using
move.l #CACRF_EnableI,d0 ;enable instruction cache
move.l d0,d1 ;mask
jsr (resload_SetCACR,a0)
MOVE.B _keyexit(PC),d0
LEA.L KEYHP\.qkey(PC),a0
MOVE.B d0,(A0)
move.b #$81,$bfed01
MOVEQ #0,D0
MOVE.L #$1770,D1
LEA $20000,A0
MOVEQ #1,D2
MOVE.L _resload(PC),A2
jsr (resload_DiskLoad,a2)
;check disk version
IFEQ 1
MOVE.L #$1200,D0
LEA.L $7FC.W,A0
jsr (resload_CRC16,a2)
moveq #1,d1
cmp.w #crc_v1,d0
beq .set
moveq #2,d1
cmp.w #crc_v2,d0
beq .set
bra _badver
.set lea version,a0
move.w d1,(a0)
LEA.L $400.W,A0
MOVE.W #$100-2,D0
.CLR1 CLR.L (A0)+
DBF D0,.CLR1
MOVE.W version(PC),D1
CMP.W #2,D1
BEQ.S .V2
ENDC
MOVE.W #$4E75,$205DC
MOVE.W #$4E75,$20560
MOVE.W #$4E75,$205AC
MOVE.W #$4E75,$20496
MOVE.W #$4E75,$2008E
MOVE.W #$601C,$20172
MOVE.W #$4EF9,$20752
PEA LOADROUT(PC)
MOVE.L (A7)+,$20754
MOVE.W #$2000,SR
BSET #1,$BFE001
JMP $20000
leftturn
move.w $10f2.w,d0 ;if turn clock- and anticlockwise
or.w $10f6.w,d0 ;together, dont turn
beq.s .2
move.w $10f4.w,d0
or.w $10f8.w,d0
bne.s .return
.2 lea.l lturn(PC),a2 ;added controls
tst.w $10f2.w
beq.s .1
tst.b (A2)
bne.s .skip
st (A2)
ZEROCLEAR
rts
.1 sf (A2)
.skip tst.w $10f6.w
rts
.return addq.l #4,a7 ;skip rest of mirrorturn
rts
rightturn
lea.l rturn(PC),a2
tst.w $10f4.w
beq.s .1
tst.b (A2)
bne.s .skip
st (A2)
ZEROCLEAR
rts
.1 sf (A2)
.skip tst.w $10f8.w
rts
pause
movem.l a0/a1/d0,-(A7)
lea.l $3c42.w,a0
lea.l lastp(PC),a1
move.b (A1),d0
move.b $59*2(A0),(A1)
beq.s .skip
tst.b d0
bne.s .nochange
;toggle pause mode
not.b 1(A1)
.nochange
tst.b 1(A1)
bne.s .pause
.skip
movem.l (A7)+,a0/a1/d0
addq.l #1,$3c02.w
rts
.pause
MOVEM.L (A7)+,a0/a1/d0
addq.l #4,a7
rts
;D0-PARTADDY
;20822-PARTAREA
; 0(PARTAREA,D0*$10) - MEMDEST
; 4(PARTAREA,D0*$10) - STARTTRACK
; C(PARTAREA,D0*$10) - LENGTH
LOADROUT
MOVEM.L D0-A6,-(A7)
MOVE.L D0,D6
MULU #$10,D0
LEA.L $20822,A1
MOVEQ.L #1,D2 ;DISK#
MOVE.L $C(A1,D0.W),D1 ;LENGTH
MOVE.L (A1,D0.W),A0 ;MEMDESTINATION
MOVE.L 4(A1,D0.W),D0
SUBQ.W #2,D0
MULU #$1770,D0 ;DISKSTART
move.l (_resload,pc),a3
jsr (resload_DiskLoad,a3)
CMP.B #1,D6
BNE.W .EX
MOVE.W #$4EB9,$912.W
PEA KEYHP(PC)
MOVE.L (A7)+,$914.W
MOVE.W #$4E77,$827E ;correct stackframe
; move.w #$4afc,$1394.w
move.w #$c2,$12c8.w ;fix keyboard problem: shift as firebutton
move.w #$4ef9,$2cb4.w
pea SAVEHIGH(PC)
move.l (A7)+,$2cb6.w
move.w #$4eb9,$138c.w
pea leftturn(PC)
move.l (A7)+,$138e.w
move.w #$4eb9,$139e.w
pea rightturn(PC)
move.l (A7)+,$13a0.w
move.w #$4eb9,$3c06.w
pea pause(PC)
move.l (A7)+,$3c08.w
ifeq 1
MOVE.L #$800,D0
LEA.L $6000.w,A0
MOVE.L _RESLOAD(PC),A2
JSR RESLOAD_PROTECTWRITE(A2)
endc
lea HINAME(PC),a0 ;filename
move.l _resload(PC),a3
jsr (resload_GetFileSize,a3)
tst.l d0
beq.s .EX
move.l $3bf0.w,d7
move.l $3bf4.w,d6
LEA.L $3b3c.w,A1
MOVE.L #$bc,D0
lea HINAME(PC),a0 ;filename
jsr (resload_LoadFile,a3)
lea.l $3b3c.w,a1
moveq.l #($b4/4)-1,d1
moveq.l #0,d0
moveq.l #0,d2
.sum add.l (A1)+,d0
eor.l d0,d2
dbf d1,.sum
cmp.l $3bf0.w,d0
bne.w quit
cmp.l $3bf4.w,d2
bne.w quit
move.l d7,$3bf0.w
move.l d6,$3bf4.w
.EX MOVEM.L (A7)+,D0-A6
MOVEQ.L #0,D0
RTS
SAVEHIGH
move.w $2cc0.w,$3d52.w
MOVEM.L D0-D2/A0-A2,-(A7)
move.l $3bf0.w,d7
move.l $3bf4.w,d6
LEA.L $3b3c.W,A1 ;ADDY
moveq.l #($b4/4)-1,d1
moveq.l #0,d0
moveq.l #0,d2
.sum add.l (A1)+,d0
eor.l d0,d2
dbf d1,.sum
move.l d0,$3bf0.w
move.l d2,$3bf4.w
LEA.L $3b3c.W,A1 ;ADDY
MOVE.L #$bc,D0 ;len
lea HINAME(PC),a0 ;filename
move.l _resload(pc),a2
jsr (resload_SaveFile,a2)
move.l d7,$3bf0.w
move.l d6,$3bf4.w
.SKIP MOVEM.L (A7)+,D0-D2/A0-A2
RTS
;version dc.w 0 ;version of disks
_resload dc.l 0 ;address of resident loader
HINAME dc.b 'deflhigh',0
lturn dc.b 0
rturn dc.b 0
lastp dc.b $ff
spause dc.b 0
even
;======================================================================
; RAW-Key-Codes:
; ESC $45
; DEL $46
; F1..F10 $50..$59
; HELP $5f
KEYHP MOVE.B D0,$8EE.W
CMP.B #$59,D0
.qkey equ *-1
BEQ.W QUIT
RTS
QUIT
.exit pea TDREASON_OK
; bra _end
;_badver pea TDREASON_BADVERSION
_end move.l (_resload,pc),-(a7)
add.l #resload_Abort,(a7)
rts